﻿using OilRigSumoWrestlers.Scenes.Network;
using RaptorEngine;
using RaptorEngine.Components.Drawable;
using RaptorEngine.Managers;

namespace OilRigSumoWrestlers.Entities.MenuItems.NetworkItems
{
    class MultiplayerJoinItem : MenuItem
    {
        public MultiplayerJoinItem(DrawableText selectedText, DrawableText deselectedText) 
            : base(selectedText, deselectedText)
        {
        }

        public override void Execute()
        {
            GameEngine.Instance.Scene.HideCurrentScene();
            GameEngine.Instance.Scene.StopCurrentScene();
            GameEngine.Instance.Scene.RemoveCurrentScene();
            GameEngine.Instance.Scene.PushScene(new JoinGame(false));
            GameEngine.Instance.Scene.StartCurrentScene();
            GameEngine.Instance.Scene.ShowCurrentScene();
        }
    }
}
